package fabworkz.anna;

import root.gast.speech.activation.SpeechActivationService;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

public class MainActivity extends Activity {
//	private static final String TAG = "ANNA";
//    private RecordAudioTask recordAudioTask; 
//    private RecordAmplitudeTask recordAmplitudeTask;
//    private static final int REQUEST_CODE = 1010;

//    private static final int REQUEST_CODE = 1010;
//    private Intent intent;
//    private Messenger messenger;
//    
//	private Handler handler = new Handler() {
//        public void handleMessage(Message message) {
//          Object obj = message.obj;
//          if (message.arg1 == RESULT_OK && obj != null) {
//              	//startVoiceRecognitionActivity();
//          } else {
//            Toast.makeText(MainActivity.this, "Download failed.",
//                Toast.LENGTH_LONG).show();
//          }
//
//        };
//      };


  /**
   * Handle the action of the button being clicked
   */
private static final String TAG = "ANNAMain";
    
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.speechactivationservice);
        startService("clapper");
        finish();
//        hookButtons();
    }
    
//    private void hookButtons()
//    {
//        List<Button> startButtons = new ArrayList<Button>();
//        startButtons.add(makeStartButton(R.id.btn_speech_activation_movement, R.string.speech_activation_movement));
//        startButtons.add(makeStartButton(R.id.btn_speech_activation_clap, R.string.speech_activation_clap));
//        startButtons.add(makeStartButton(R.id.btn_speech_activation_camera, R.string.speech_activation_camera));
//        startButtons.add(makeStartButton(R.id.btn_speech_activation_speak, R.string.speech_activation_speak));        
//    }
    private void stopService(){
        Log.d(TAG, "stop service");
        Intent i = SpeechActivationService.makeServiceStopIntent(this);
        startService(i);
    }
    private void startService(String name){
        String activationTypeName = name;
        Intent i = SpeechActivationService.makeStartServiceIntent(this,
                activationTypeName,0);
        startService(i);
        Log.d(TAG, "started service for " + activationTypeName);
    }
}
